package com.sys.basics.dao;

import org.apache.ibatis.annotations.Mapper;
import com.sys.basics.entity.SysOrg;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: ares
 * @date: 2021-10-08
 * @description: 系统组织表 Mapper 接口
 */
@Mapper
public interface SysOrgDao extends BaseMapper<SysOrg> {
    SysOrg getTreeById(Long id);

    SysOrg getTreeByIdWithRole(Long id);

    List<SysOrg> getChildrenTreeByParentId(Long parentId);

    List<SysOrg> getChildrenTreeByParentIdWithRole(Long parentId);

    List<SysOrg> getCurrentUserOrgs(Long userId);

    List<SysOrg> getCurrentUserOrgsWithRole(Long userId);

    List<SysOrg> getListByUserIdWithRole(@Param("userId") Long userId, @Param("orgType") String currentOrgType);

    List<SysOrg> getChildrenByParentId(Long parentId);

    List<SysOrg> getChildrenByParentIdWithRole(Long parentId);

}
